package com.xdb.sqlparser.ast.statement;

import com.xdb.sqlparser.ast.SQLExpr;
import com.xdb.sqlparser.ast.AbstractSQLStatementImpl;
import com.xdb.sqlparser.visitor.SQLAstVisitor;

public class SQLDropDatabaseStatement extends AbstractSQLStatementImpl implements SQLDDLStatement {

	private SQLExpr database;
	private boolean ifExists;

	public SQLDropDatabaseStatement() {

	}

	public SQLDropDatabaseStatement(String dbType) {
		super(dbType);
	}

	@Override
	protected void accept0(SQLAstVisitor visitor) {
		if (visitor.visit(this)) {
			acceptChild(visitor, database);
		}
		visitor.endVisit(this);
	}

	public SQLExpr getDatabase() {
		return database;
	}

	public void setDatabase(SQLExpr database) {
		if (database != null) {
			database.setParent(this);
		}
		this.database = database;
	}

	public boolean isIfExists() {
		return ifExists;
	}

	public void setIfExists(boolean ifExists) {
		this.ifExists = ifExists;
	}

}
